# -*- coding: utf-8 -*-
# @Author: slp
# @Date:   2018-05-23 12:53:25
# @Last Modified by:   slp
# @Last Modified time: 2018-05-23 13:40:02

import sys

# d53c4001
# op0:19:20
# op1: 16-18
# crn: 12-15
# crm: 8-11
# op2: 5-7
# 

def sys_inst_encode(opcode):
	s = bin(opcode).replace("0b", '')
	rinx = 31
	op0 = int(s[rinx-20:rinx-19+1], 2)
	op1 = int(s[rinx-18: rinx-16+1], 2)
	crn = int(s[rinx-15: rinx-12+1], 2)
	crm = int(s[rinx-11: rinx-8+1], 2)
	op2 = int(s[rinx-7: rinx-5+1], 2)
	print "mrs x1, S%d_%d_c%d_c%d_%d"%(op0, op1, crn, crm, op2)
	return op0, op1, crn, crm, op2

# mrs x0, S<o0>_<op1>_C<CRn>_C<CRm>_<op2>
# mrs x1, SPSR_EL2
# b = 0xd53c4001
# sys_inst_encode(b)

def main():
	# sys.argv.append("0xd53c4001")
	if len(sys.argv) != 2:
		print "usage: %s opcode"%(sys.argv[0])
		sys.exit(1)
	ops = sys.argv[1].lower()
	op = None
	try:
		op = long(ops, 10)
	except ValueError as e:
		try:
			op = long(ops, 16)
		except Exception as e:
			raise e
	sys_inst_encode(op)

if __name__ == '__main__':
	main()

